package com.qf.myshop.service.impl;

import com.qf.myshop.dao.TypeDAO;
import com.qf.myshop.dao.impl.TypeDAOImpl;
import com.qf.myshop.entity.Type;
import com.qf.myshop.service.TypeService;
import com.qf.myshop.utils.JDBCUtils;

import java.sql.SQLException;
import java.util.List;

public class TypeServiceImpl implements TypeService {
    private TypeDAO typeDAO = new TypeDAOImpl();

    @Override
    public List<Type> findAll() {
        try {
            return typeDAO.findAll();
        } catch (SQLException e) {
            e.printStackTrace();
        }finally {
            try {
                JDBCUtils.close();
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }
        return null;
    }
}
